within ThreeD_MBS_Dynamics.Examples.Rattleback;

model Case_of_Borisov_Test
  parameter SI.Acceleration g=100;
  inner parameter SI.Acceleration[3] Gravity={0,-g,0};
  // Ellipsoid semi-diameters
  inner parameter SI.Length a1=2;
  inner parameter SI.Length b1=1;
  inner parameter SI.Length c1=3;
  inner parameter SI.Length delta=-0.2;
  annotation (
    Diagram,
    experiment(
      StopTime=500,
      NumberOfIntervals=100000,
      Tolerance=1e-010),
    experimentSetupOutput);
  Base Base1 annotation (extent=[-60, 0; -40, 20]);
  RollingBody RollingBody1(
    q(start={1,0,0,0}),
    r(start={0,1,0}),
    I=[6, 0, 0; 0, 7, 0; 0, 0, 5],
    v(start={2,0,0}),
    omega(start={0,19,-2})) annotation (extent=[20, 0; 40, 20]);
  Ellipsoid_on_Plane Ellipsoid_on_Plane1 annotation (extent=[-20, 0; 0, 20]);
equation
  connect(Base1.InPortRoll, Ellipsoid_on_Plane1.OutPortA) 
    annotation (points=[-50, 19; -50, 30; -13, 30; -13, 19]);
  connect(Base1.OutPort, Ellipsoid_on_Plane1.InPortA) 
    annotation (points=[-50, 1; -50, -10; -13, -10; -13, 1]);
  connect(Ellipsoid_on_Plane1.InPortB, RollingBody1.OutPort) 
    annotation (points=[-7, 1; -7, -10; 30, -10; 30, 1]);
  connect(Ellipsoid_on_Plane1.OutPortB, RollingBody1.InPortRoll) 
    annotation (points=[-7, 19; -7, 30; 30, 30; 30, 19]);
end Case_of_Borisov_Test;
